home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
EnigmA Amiga Run 1996 June
/
EnigmA AMIGA RUN 08 (1996)(G.R. Edizioni)(IT)[!][issue 1996-06][EARSAN CD VII].iso
/
earcd
/
games1
/
bridgscr.lha
/
bridgescore
/
BridgeScore.doc
< prev
next >
Wrap
Text File
|
1996-04-26
|
7KB
|
203 lines
BridgeScore
Welcome to BridgeScore - the duplicate bridge scoring system.
Introduction
The idea of this program is to calculate the overall scores of the
participants in a duplicate bridge tournament.
The user (that's you!) will have to type in the results from the
travellers (the scorecards accompanying each board). You then give
BridgeScore this file, and an output file where the results will be
output, along with summaries for each board. This file can be read,
edited or sent straight to the nearest printer.
BridgeScore will attempt to tell you about any errors in your data
file that it detects.
How Scoring Works
If you are scoring for a duplicate bridge tournament, you probably
understand scoring anyway. However, I will try to explain the system
I have been using to write this program. You would also like to have
the computer do the work rather than you!
First, take one board.
1. Sort the North-South pairs into order, depending on their raw score
2. Allocate points depending on the position, with the top pair
getting 2*(N-1) points, and decreasing by 2 for each lower position to
zero points for the bottom pair. Here N is the number of pairs (NS)
on that board. Equal positions will share the points e.g. if 2 pairs
came joint bottom, they would share the 2 and 0 points to get 1 point
each.
3. Also note the maximum possible score possible on that board - each
pair could have got the maximum 2*(N-1) points.
4. East-West pair scores can be calculated from the scores and
positions of their North-South opponents.
Repeat all this for each board.
Now sum up.
1. For each pair, sum all the points they gained from their positions
on each board.
2. Also get their maximum possible scores.
3. Divide (1) by (2) to get their percentage score.
4. Allocate overall positions based on this percentage - so North-
South and East-West have their own, separate league tables.
Operation
First comes the hard part. Take all your traveller cards after the
tournament, sit down in front of your favourite text editor (Workbench
ed is a poor choice I find - it adds too much junk to the start of
files; CygnusEd, dme, memacs seem OK though) and type in the results,
as detailed - "file input".
Now, for safety, copy this file to disk, and put a copy in ram: (you
can never trust other people's programs with important files,
especially PD). Now choose a location for the output file (e.g.
ram:outputfile).
Open a shell and type 'BridgeScore ram:inputfile ram:outputfile'.
If all goes well, look at "file output" to explain the results. If
there are any problems, BridgeScore will try to tell you what happened
and on which line, as well as it can.
File Input
You will need to now the format for the input files.
N.B. Workbench Ed seems to add lots of junk to the start of files,
making them hard to read. Until I have looked further into this,
do not use this. Others are OK, on most computer formats without
translation.
First, give the number of boards.
Next line, give the number of pairs playing North-South.
Next line, give the number of pairs playing East-West. This should be
equal to or one greater than the number of North-South pairs.
Now comes the data for the boards.
Now give the scores, on each line giving a board number, NS pair, EW
pair, score to NS.
e.g. '2 1 2 -50' means Board 2, NS pair 1 played EW pair 2, EW won
with a score of 50 (or -50 to NS).
Put each of these scores on a separate line.
Always place these in the above order, although any order can be used
for the lines themselves, i.e. you don't need to group all the scores
for Board 1 together.
Finally, put the word 'end' after your data - just in case your editor
makes a mess at the end of its files.
Example
2
2
3
1 1 2 -50
1 2 1 0
2 1 3 300
2 2 1 100
end
There were 2 boards, with 2 pairs playing North-South (each played 2
boards), and 3 played East-West (pairs 2 and 3 only played one board).
On board 1, EW2 gained a score of 50 against NS1. NS2 and EW1 passed
out (good for NS2).
For board 2, NS1 gained 300 points against EW3. NS2 only gained 100
points against EW1. EW2 did not play on this board.
File Output
The first data to be written to the output file are the board
summaries. The board number is given, then the pairs playing each
other, the raw scores (to NS), and the position of the NS pair on the
board. This is repeated for each board given.
Following this are the overall results. On the left are the NS
results, giving each pair, their overall percentage score and their
position. On the right, the same for EW.
Problems
BridgeScore will give a little information about problems it
encounters in a data file.
Note that it may get confused on subsequent errors.
It should spot the following:
1. Too many boards or pairs - maximum 45 boards and 30 pairs
2. Some illegal scores e.g. 4, 412 etc.
3. Not declaring all the data on a line e.g. missing off the score.
Not detected yet.
1. Giving data for an undeclared board - this may crash program!
2. Giving data in wrong order on line - may be noticed by subsequent
effects?
3. Rogue characters e.g. letters.
4. Tell me!
Disclaimer and Copyright
Disclaimer
This program is supplied 'as is' and without warranty of any type. No
responsibility is accepted for any damage or loss to your hardware,
data or yourself and any third parties - the risk is all yours!
Copyright
This program is supplied as freeware - there is no charge for use of
it in any circumstances. You are free to distribute it in its
original archive only with all accompanying documentation, and the
copyright remains with the author.
Author
Trevor Wright
PhD student at Cambridge University, studying the metal-insulator
transition metal-semiconductor films.
e-mail: tw116@cus.cam.ac.uk - note that this address will terminate
sometime in the summer of 1996.
Motivation - I originally wrote this in AMOS, to help my parents who
are occasional tournament directors at their local bridge clubs. This
is the conversion to C, so I can maintain the program into the future.
The Amiga version was compiled in SAS/C 6.56 on an A1200; I hope to
compile this for IBM's later on (in which case, there will be no
amigaguide documentation!) This is still a beta version, but it seems
OK. Please feel free to make any comments, point out bugs, etc. to my
e-mail address.
To Do
I found no performance increase for compiles to higher
processors/coprocessors, so none are included. You will find the
speed fast enough anyway, even on the slower computers (it used to run
in BASIC, remember). Typing in the data won't be so fast though!
Assuming there are no bugs in the scoring, my attention will probably
be directed towards the file input side. To make this directly
portable though, there will be no fancy GUI's. I will try to work on
any problems pointed out to me. In addition, I may consider adapting
the program to other board movements.
This version is 0.9 beta.